package fields;

import java.util.Map;

public class Chanceliste {
	
	private Chancekort[] chanceliste;
	private int cardFromDeck;
	
	public Chanceliste(Map<String, String> translations){
		this.cardFromDeck = 0;
		
		this.chanceliste     = new Chancekort [16];
		chanceliste[0] = new Chancekort (250, 0, translations.get("CHANCE_BANK_MISTAKE"));
		chanceliste[1] = new Chancekort (25, 1, translations.get("CHANCE_SOLD_ACTIONS"));
		chanceliste[2] = new Chancekort (0, 2, translations.get("CHANCE_FREEDOM_CARD"));
		chanceliste[3] = new Chancekort (25, 3, translations.get("CHANCE_SOLD_ACTIONS"));
		chanceliste[4] = new Chancekort (100, 4, translations.get("CHANCE_GET_LEGACY"));
		chanceliste[5] = new Chancekort (25, 5, translations.get("CHANCE_TAX_RETURN"));
		chanceliste[6] = new Chancekort (0, 6, translations.get("CHANCE_GOTO_PRISON"));
		chanceliste[7] = new Chancekort (-50, 7, translations.get("CHANCE_LIFE_INSURANCE"));
		chanceliste[8] = new Chancekort (10, 8, translations.get("CHANCE_MISS_UNIVERSE"));
		chanceliste[9] = new Chancekort (50, 9, translations.get("CHANCE_STOCK_MARKET"));
		chanceliste[10] = new Chancekort (-100, 10, translations.get("CHANCE_PAY_HOSPITAL"));
		chanceliste[11] = new Chancekort (0, 11, translations.get("CHANCE_GO_BACK"));
		chanceliste[12] = new Chancekort (100, 12, translations.get("CHANCE_COLLECTED_RENT"));
		chanceliste[13] = new Chancekort (10, 13, translations.get("CHANCE_BIRTHDAY"));
		chanceliste[14] = new Chancekort (-10, 14, translations.get("CHANCE_CHANCE_AGAIN"));
		chanceliste[15] = new Chancekort (-50, 15, translations.get("CHANCE_PAY_DOCTOR"));
	}
	
	public Chancekort getChancekort(int chancenumber)
	{
		return this.chanceliste[chancenumber];
	
	}

	
	public void pickCard()
	{ 
		this.cardFromDeck=(int)(Math.random()*16);
	}
	
	public Chancekort getcardFromDeck ()
	{
		return this.chanceliste [this.cardFromDeck];
	}
}
